package com.example.demo.controller;

import com.example.demo.model.req.WoWorkTrackingAdviceReq;
import com.example.demo.model.req.WoWorkTrackingSaveReq;
import com.example.demo.service.WorkOrderService;
import com.example.demo.utils.RespBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/workorder")
@CrossOrigin
public class WorkOrderController {
    @Autowired
    WorkOrderService workTrackingService;


    @PostMapping("/saveProgress")
    public RespBean saveProgress(@RequestBody WoWorkTrackingSaveReq trackingSaveReq)
    {
        workTrackingService.reportProgress(trackingSaveReq);
        return RespBean.success();
    }

    @PostMapping("/saveAdviceProgress")
    public RespBean saveAdviceProgress(@RequestBody WoWorkTrackingAdviceReq trackingSaveReq)
    {
        workTrackingService.repostAdviceProgress(trackingSaveReq);
        return RespBean.success();
    }



    @PostMapping("/list")
    public RespBean showProgress()
    {
        return RespBean.success();
    }
}
